<template>
	<view class="f26r col363636 p20r">
		<view class="borRad10r backColWhite pl20r pr20r pb20r">
			<view class="f30r foWeiBold lh80r">
				房间详情
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					房间名称：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.name}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					起订时长：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.hour}}小时
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					适用人数：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.people_count}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					原价：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					<text class="colCe2e37">
						¥{{roomData.price}}
					</text>
					/小时
				</view>
			</view>
			<!-- <view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					VIP价格：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					<text class="colCe2e37">
						¥{{roomData.vip_price}}
					</text>
					/小时
				</view>
			</view> -->
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					必购套餐：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{
						roomData.set_meal_type == 1 ? '是' :
						roomData.set_meal_type == 2 ? '否' : roomData.set_meal_type
					}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w150r col7a7a7a">
					开放/关闭：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{
						roomData.type == 1 ? '开放' :
						roomData.type == 2 ? '关闭' : roomData.type
					}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					排序：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.sort}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					房间标签：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.labels}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					WIFI：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.wifi}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					房间id：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.id}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					门锁key：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.door_key}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					开关key：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.switch_key}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					音响key：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.music_key}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w160r col7a7a7a">
					到点提示音：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.music_text}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					轮播图：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					<view v-if="bannerList.length == 0">
						无
					</view>
					<view class="" v-if="bannerList.length">
						<image :src="item" mode="aspectFill"
							class="w150r h150r borRad10r bor1SE8e8e8 ml10r"
							v-for="(item, index) in bannerList" :key="index"
							@click="cliBannerImg(index)"
						></image>
					</view>
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					房间介绍：
				</view>
				<view class="flex1 bor1SE8e8e8">
					<rich-text :nodes="roomData.remarks"
					></rich-text>
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					温馨提示：
				</view>
				<view class="flex1 foWeiBold bor1SE8e8e8">
					<view v-for="(item, index) in roomData.markedAry" :key="index" class="lh50r">
						{{item}}
					</view>
				</view>
			</view>
			<!-- <view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					房间id：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.id}}
				</view>
			</view>
			<view class="disFlex mt20r">
				<view class="w130r col7a7a7a">
					茶室tid：
				</view>
				<view class="flex1 teAliRight foWeiBold">
					{{roomData.tid}}
				</view>
			</view> -->
		</view>
		<button class="colFff lh70r mt40r f26r backCol64aeb4"
			@click="cliModifyBtn"
		>
			修改房间信息
		</button>
	</view>
</template>
<script>
import { inquiryToLogin, formatRichText } from '@/utils/utils.js'
import { baseUrl } from '@/utils/request'
export default {
	data() {
		return {
			// baseUrl,
			roomData: {},
			bannerList: []
		}
	},
	onLoad(options) {
		inquiryToLogin().then(res => {
			this.roomData = uni.getStorageSync('roomDetail');
			console.log(22, this.roomData)
			uni.removeStorageSync('roomDetail');
			// if(options.item) {
				// this.roomData = JSON.parse(options.item);
				if(this.roomData.pic && this.roomData.pic != '') {
					this.roomData.pic.split(',').forEach(item => {
						this.bannerList.push(baseUrl + item);
					})
				}
				this.roomData.remarks = formatRichText(this.roomData.remarks);
				if(this.roomData.marked_words) {
					this.roomData.markedAry = this.roomData.marked_words.split("|");
				}
			// }
		});
	},
	methods: {
		cliModifyBtn() {
			uni.setStorageSync('addRoomDetail', this.roomData);
			uni.navigateTo({
				url: '/pages/index/addRoomDetail?type=2'
			})
		},
		cliBannerImg(current) {
			uni.previewImage({
				current, urls: this.bannerList
			})
		}
	}
}
</script>
<style>
</style>